package org.zachary.agent.domain.aggregate_model.user;

import jakarta.persistence.Embeddable;

import java.util.Objects;

@Embeddable
public class Username {
    private String username;

    public Username(String value) {
        this.username = value;
    }
    protected Username() {}
    public String getValue() {
        return username;
    }
    public String toString() {
        return username;
    }
    public boolean equals(Object o) {
        if(this == o) return true;
        if(o == null || getClass() != o.getClass()) return false;
        Username u = (Username) o;
        return Objects.equals(username, u.username);
    }
    public int hashCode() {
        return Objects.hash(username);
    }
}